package com.sgffsg.mygirl.utils;

import com.sgffsg.mygirl.entity.ResultEntity;

/**
 * Created by work on 2017/9/24.
 */
public class ResultUtil {

    public static ResultEntity success(Object object){
        ResultEntity resultEntity=new ResultEntity();
        resultEntity.setCode(0);
        resultEntity.setMsg("成功");
        resultEntity.setData(object);
        return resultEntity;
    }

    public static ResultEntity successt(){
        return success(null);
    }

    //统一处理失败
    public static ResultEntity error(Integer code,String msg){
        ResultEntity resultEntity=new ResultEntity();
        resultEntity.setMsg(msg);
        resultEntity.setCode(code);
        return resultEntity;
    }

}
